﻿/// Write a program that parses an URL address given in the format:
/// [protocol]://[server]/[resource] and extracts from it the
/// [protocol], [server] and [resource] elements.

/// For example from the URL http://www.devbg.org/forum/index.php the following information should be extracted:
/// [protocol] = "http"
/// [server] = "www.devbg.org"
/// [resource] = "/forum/index.php"


using System;
using System.Text.RegularExpressions;

class zad12
{
    static void Main()
    {
        string uri = "http://www.devbg.org/forum/index.php";

        GroupCollection collection = Regex.Match(uri, "(.*)://(.*?)(/.*)").Groups;

        foreach (var item in collection)
        {
            Console.WriteLine(item);
        }
    }

}

